#ifndef MY_CRC_H
#define MY_CRC_H

#include <QObject>


#define PORT_SIZE_MAX_F210 524

#define CMD_MCU_PC_SYNC  0x00000000
#define CMD_PC_MCU_SYNC  0x00000001
#define CMD_REPEAT_PAGE  0x000a0000
#define CMD_RD_MTSN_PAGE 0xa0000000
#define CMD_WR_MTSN_PAGE 0xb0000000
#define CMD_PC_UPD_PAGE  0xc0000000
#define CMD_ERROR_PAGE   0xe0000000
#define CMD_PC_UPD_DONE  0xc0FFFFFF
#define CMD_PC_FPGA_DONE 0xc1FFFFFF
#define CMD_PC_FILE_SIZE 0xc2000000


extern uint32_t Crc32;
extern uint32_t DatLen;


bool myserial_CmdCrc(QByteArray &CmdBuff, int CmdSize);
bool myserial_Cmd_Check(QByteArray data);
uint8_t myserial_EccCalc(QByteArray CmdBuff);
uint16_t crc16_result(QByteArray x,uint16_t x_size);
void generateRandomNumber(QByteArray &arr,int iArrLen);
bool F210_Cmd_Check(QByteArray data);
QByteArray F210_CmdPacket(QByteArray LineStr,QByteArray CmdStr);

void LipsCrc32_Calc(QByteArray CalcBuff, int CalcSize);


#endif // MY_CRC_H
